﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using QFramework;

namespace Course
{
	public enum GameEvent
	{
		Start = QMgrID.Game,
		TestEvent,
		End
	}

	public class TestGameManager : QMonoBehaviour 
	{
		public override IManager Manager 
		{
			get 
			{
				return GameManager.Instance;
			}
		}
		// Use this for initialization
		void Start ()
		{
			GameManager.Instance.Init();

			Log.E((int)GameEvent.TestEvent);

			RegisterEvent(GameEvent.TestEvent);

			SendEvent(GameEvent.TestEvent);
		}

		protected override void ProcessMsg(int eventKey, QMsg msg)
		{
			if (eventKey == (int)GameEvent.TestEvent)
			{
				Log.E("received msg TestGameManger");
			}
		}
	
		// Update is called once per frame
		void Update () {
		
		}
	}

	public class GameManager : QMgrBehaviour,ISingleton
	{
		// TimelineManager
		// EnemyManager
		// NPC/ChacterManager

		public static GameManager Instance
		{
			get 
			{
				return MonoSingletonProperty<GameManager>.Instance;
			}
		}

		void ISingleton.OnSingletonInit()
		{

		}


		protected override void ProcessMsg(int eventKey, QMsg msg)
		{
			Log.E("received msg GameManager:{0}",eventKey);
			base.ProcessMsg(eventKey, msg);
		}

		public override int ManagerId 
		{ 
			get 
			{
				return QMgrID.Game;
			} 
		}

		void GameStart()
		{

		}

		void GameOver()
		{

		}

		void GamePause()
		{

		}

		void GameResume()
		{

		}

	}
}